﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ClassProject.Entity;
using Microsoft.ApplicationBlocks.Data;

namespace ClassProject.DAL
{
    class CategoryDAL:ADONET
    {
        private CategoryEntity categoryEntity = new CategoryEntity();

        public CategoryDAL()
        {
            
        }

        #region Insert data table Category
        public int Insert()
        {
            int i = SqlHelper.ExecuteNonQuery(this._strCon, "sp_Category_Insert", categoryEntity.IDParent, categoryEntity.Name);
            return i;
        }
        #endregion

        #region Update data table Category
        public int Update()
        {
            int i = SqlHelper.ExecuteNonQuery(this._strCon, "sp_Category_Update", categoryEntity.IDParent, categoryEntity.Name, categoryEntity.CategoryID);
            return i;
        }
        #endregion

        #region Delete data table Category
        public int Delete()
        {
            int i = SqlHelper.ExecuteNonQuery(this._strCon, "sp_Category_Delete", categoryEntity.CategoryID);
            return i;
        }
        #endregion
    }
}
